//
//  LZMeCell.m
//  LZBS
//
//  Created by 郝庆 on 16/6/10.
//  Copyright © 2016年 haoqing. All rights reserved.
//

#import "LZMeCell.h"

@implementation LZMeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.imageView.contentMode = UIViewContentModeScaleAspectFit;
        
        // 右边箭头效果
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        self.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mainCellBackground"]];
    }
    
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    if (self.imageView.image == nil) return;
    
    // imageView
    self.imageView.lz_y = LZSmallMargin;
    self.imageView.lz_height = self.contentView.lz_height - 2 * LZSmallMargin;
    self.imageView.lz_width = self.imageView.lz_height;
    
    // label
    self.textLabel.lz_x = self.imageView.lz_right + LZMargin;
}
@end
